package bit;

public class Demo2 {
	public static void main(String[] args) {
		int i = 10;
		i <<= 1; // i = i << 1;    i = i *2;  i *=2;
		System.out.println(i);
		i >>= 1;
		System.out.println(i);
		
		int a = 1, b = 2;
		// 东软集团 ，不产生第三个变量的情况下，交换a和b的值
//		a = a + b;  // a = 3;
//		b = a - b;  // b = 1
//		a = a - b;  // a = 2;
		a = a ^ b;   // a = a ^ b
		b = a ^ b;   // b = a ^ b
		a = a ^ b;   // a = a ^ b
		System.out.println(a);
		System.out.println(b);
		
	}
}
